LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

define walk
  $(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e)))
endef
 
#traverse Classes Directory
ALLFILES := $(call walk, $(LOCAL_PATH)/../../Classes) \
			$(call walk, $(LOCAL_PATH)/../../Common)


FILE_LIST := hellocpp/main.cpp
FILE_LIST += $(filter %.cpp, $(ALLFILES))
FILE_LIST += $(filter %.c, $(ALLFILES))
 
FILE_INCLUDES := $(shell find $(LOCAL_PATH)/../../Classes -type d)
 
#source file will be compiled
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
					$(LOCAL_PATH)/../../Classes/collision\
					$(LOCAL_PATH)/../../Common \
					$(LOCAL_PATH)/../../Common/MemBlock \
					$(LOCAL_PATH)/../../Common/Socket \
					$(LOCAL_PATH)/../../Common/System \
					$(LOCAL_PATH)/../../cocos2d/external/iconv/include \
					$(LOCAL_PATH)/../../Classes/Manager \
					$(LOCAL_PATH)/../../Classes/Utils \
					$(LOCAL_PATH)/../../Classes/UI \
					$(LOCAL_PATH)/../../Classes/FSM \
					$(LOCAL_PATH)/../../Classes/Game \
					$(LOCAL_PATH)/../../Classes/Game/Character \
					$(LOCAL_PATH)/../../Classes/Game/Layer \
					$(LOCAL_PATH)/../../Classes/Tmp \

					


# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END


LOCAL_STATIC_LIBRARIES := cocos2dx_static iconv_static

# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END

include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,iconv)

# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END
